package com.tjp.user.controller;

import com.tjp.bean.Result;
import com.tjp.page.PageResponse;
import com.tjp.user.bo.AuthUserBO;
import com.tjp.user.convert.AuthUserBoConvert;
import com.tjp.user.convert.AuthUserDtoConvert;
import com.tjp.user.dto.AuthUserDTO;
import com.tjp.user.service.AuthUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @program: ape-frame
 * @description: 用户vc
 * @author: aaronTang
 * @create: 2024-05-17
 */
@RestController
@RequestMapping("/authUser")
public class AuthUserController {

    @Resource
    private AuthUserService authUserService;


    @GetMapping("/getPage")
    public Result<PageResponse> queryByPage(@RequestBody AuthUserDTO authUserDTO) {

        AuthUserBO authUserBO = AuthUserBoConvert.INSTANCE.convertAuthUserDtoToBo(authUserDTO);

        PageResponse pageResponse = authUserService.queryByPage(authUserBO);
        return Result.ok(pageResponse);
    }
}
